var sh=null;
function sprite_action()
{
    var canvas = document.getElementById("canvas");
    var context = canvas.getContext("2d");
    sh=setInterval(function(){
        run(context,sh);
    }, 100);
}
function sprite_stop()
{
    if(sh)
    {
        clearInterval(sh);
    }
}
window.onload=function(){
    var canvas = document.getElementById("canvas");
    var context = canvas.getContext("2d");
    var image = new Image();
    var imageUtil = new MikuCanvasImageUtil();
    image.src ="media/Dinosaur.png";
    image.onload = function(){
        imageUtil.scaleImgInCenter(context,image,"0.4",false);   
    }
        
};
var speed=0;
function run(cxt,sh){
    speed+=-5;
    if(speed < -150)
    {
        clearInterval(sh);
    }
    cxt.clearRect(0,0,cxt.canvas.width,cxt.canvas.height);
    var img = new Image();
    var imageUtil = new MikuCanvasImageUtil();
    img.src = "media/Dinosaur.png";
    imageUtil.scaleImgMove(cxt,img,"0.4",speed,0,false);
}